<?php
/**
 * A simple description for this script
 *
 * PHP Version 5.2.0 or Upper version
 *
 * @package    Iris
 * @author     Hidehito NOZAWA aka Suin <http://suin.asia>
 * @copyright  2010 Hidehito NOZAWA
 * @license    http://www.gnu.org/licenses/gpl-2.0.html GNU GPL v2
 *
 */

abstract class Iris_Abstract_AdminController extends Iris_Abstract_Controller
{
	public function __construct()
	{
		if ( !defined('IRIS_ADMIN_MODE') )
		{
			die('error');
		}

		parent::__construct();

		$this->breadcrumbs   = array();
		$this->breadcrumbs[] = array(
			'name' => Iris::$cms->moduleName,
			'url'  => Iris::$url.'/admin/',
		);
	}

	protected function _view()
	{
		if ( !$this->template )
		{
			$this->template = Iris::$dirname.'.admin_'.Iris::$_controller.'.'.Iris::$_action.'.tpl';
		}

		if ( $this->pageTitle )
		{
			$this->breadcrumbs[] = array(
				'name' => $this->pageTitle,
			);
		}

		require_once XOOPS_ROOT_PATH.'/class/template.php';
		require_once XOOPS_ROOT_PATH.'/include/cp_functions.php';

		xoops_cp_header();

		$smarty = Iris::$cms->getSmarty();
		$this->_escapeHtml($this->output);
		$smarty->assign('iris', $this->output);
		$smarty->register_modifier('t', 'Iris::t');
		$smarty->register_modifier('raw', 'Iris_Class_Smarty::raw');
		$smarty->register_function('url', 'Iris_Class_Smarty::url');
		$smarty->register_modifier('currency', 'Iris_Class_Smarty::currency');
		$smarty->display('db:'.$this->template);

		xoops_cp_footer();
	}
}


?>
